package xing.design.pattern.create.factory.abstractFactory;

import xing.design.pattern.create.factory.IBasic;
import xing.design.pattern.create.factory.abstractFactory.factory.BasicFactory1;
import xing.design.pattern.create.factory.abstractFactory.factory.BasicFactory2;
import xing.design.pattern.create.factory.abstractFactory.factory.ConfigurableSimpleFactory;
import xing.design.pattern.create.factory.abstractFactory.factory.IBasicFactory;

/**
 * @author xing
 * @date 2023/2/7 23:29:55
 */
public class Main {
    public static void main(String[] args) {
        // 创建 1 系列工厂，
        IBasicFactory basicFactory1 = new BasicFactory1();
        // 得到系列对象，
        IBasic basic = basicFactory1.createBasic();
        IOtherBasic otherBasic = basicFactory1.createOtherBasic();

        // 创建 2 系列工厂
        BasicFactory2 basicFactory2 = new BasicFactory2();
        // 得到系列对象
        IBasic basic1 = basicFactory2.createBasic();
        IOtherBasic otherBasic1 = basicFactory2.createOtherBasic();

        // 反射 + 配置 + 抽象工厂实现
        // 根据配置，得到系列对象
        IBasic iBasic = ConfigurableSimpleFactory.creatBasic();
        IOtherBasic otherBasic2 = ConfigurableSimpleFactory.createOtherBasic();
    }
}
